# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libkmahjongg
pkgver=22.04.3
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked polkit -> kconfigwidgets
arch="all !armhf !s390x !riscv64"
url="https://kde.org/applications/games"
pkgdesc="Common code, backgrounds and tile sets for games using Mahjongg tiles"
license="GPL-2.0-or-later AND GFDL-1.2-only"
makedepends="
	extra-cmake-modules
	kcompletion-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	ki18n-dev
	kwidgetsaddons-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	samurai
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/libkmahjongg-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # No tests found

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
cc5d4b9a1032cfeddbbe727f7a0cf8156eace17137ef906ff4ed9aa1ee9f1184774f9003e84a30a84d93f134e0a1c449a59d15ab65cc5a1e67aa8ddf03b71ce3  libkmahjongg-22.04.3.tar.xz
"
